﻿@model ExcerciseQuestion
@{
    Layout = null;
    int index = ViewBag.index;
    int prveIndex = index - 1;
    int nextIndex = index + 1;
    List<ExcerciseQuestion> favoriteQuestions = ViewBag.favoriteQuestions;
}
@if (Model == null)
{
    <a class="button button-big button-fill button-danger">
        暂无错误题
    </a>
}
else
{
    <div style="background-color:white; border: 1px solid #e7e7e7;border-radius:4px;padding:4px;">
        @(index + 1)、(@Model.QuestTypeName)@Model.Name
    </div>
    <div class="list-block">
        <ul>
            @if (Model.A.IsNotEmpty())
            {
                <li class="item-content">
                    <div class="item-inner">
                        <div class="item-title">A、@Model.A</div>
                    </div>
                </li>
            }
            @if (Model.B.IsNotEmpty())
            {
                <li class="item-content">
                    <div class="item-inner">
                        <div class="item-title">B、@Model.B</div>
                    </div>
                </li>
            }
            @if (Model.C.IsNotEmpty())
            {
                <li class="item-content">
                    <div class="item-inner">
                        <div class="item-title">C、@Model.C</div>
                    </div>
                </li>
            }
            @if (Model.D.IsNotEmpty())
            {
                <li class="item-content">
                    <div class="item-inner">
                        <div class="item-title">D、@Model.D</div>
                    </div>
                </li>
            }
            @if (Model.E.IsNotEmpty())
            {
                <li class="item-content">
                    <div class="item-inner">
                        <div class="item-title">E、@Model.E</div>
                    </div>
                </li>
            }
        </ul>
    </div>
    <a class="button button-big button-fill" id="correct-answer" style="display: none;" data-count="@favoriteQuestions.Count">
        标准答案：@Model.Answer
    </a>

    <div class="bar bar-footer">
        <div class="row" style="height: 100%;">
            <div class="col-25"><a id="btn-answer" class="button button-success">答案</a></div>
            <div class="col-25"><a id="btn-delete" class="button button-danger" data-url="@Url.Action("DeleteQuestion", new {questionId = Model.Id})">删除</a></div>
            <div class="col-25">
                @if (prveIndex > -1)
                {
                    <a id="btn-prve" class="button" data-url="@Url.Action("_Question", new {index = prveIndex})">上一题</a>
                }
                else
                {
                    <span>&nbsp;</span>
                }
            </div>
            <div class="col-25">
                @if (nextIndex < favoriteQuestions.Count)
                {
                    <a id="btn-next" class="button" data-url="@Url.Action("_Question", new {index = nextIndex})">下一题</a>
                }
            </div>
        </div>
    </div>
}
